package com.zytlifeservice.domain.pay;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

/**
 * Created by MJS on 2017/6/20.
 */

@Entity
public class WxPayOrder {

    //订单的状态，异常的话需要进行人工介入。
    public static final int ORDER_WAIT = 0;

    public static final int ORDER_SUCCESS = 1;

    public static final int ORDER_FAIL = 2;

    public static final int ORDER_EXCEPTION = 3;

    //订单状类型说明
    public static final int TYPE_MOBILE_RECHARGE = 0;   //话费
    public static final int TYPE_MOBILE_FLOW = 1;    //流量
    public static final int TYPE_CATV = 2;  //有线电视
    public static final int TYPE_GHKD_RECHARGE = 3;  //宽带固话
    public static final int TYPE_WATER = 4;  //水费
    public static final int TYPE_ELECTRIC = 5;  //电费
    public static final int TYPE_COAL = 6;  //燃气费

    public static final int TYPE_TRAIN=7;//火车票

    public static final int TYPE_AIRPLANE=8;//飞机票


    @Id
    @GeneratedValue
    private long id;
    //------------------------------------自定义参数---------------------------------------------
    private int type;

    private Long userId;  //对应的用户ID

    private int OrderStatus;  //默认待支付，成功，失败，异常（需人工介入）

    private String refundReason;  //退款原因

    private int refundStatus = 1; //退款状态  -1,异常，需要人工介入  0，成功,1--不需要退款  //默认状态

    private String storeId;
    //----------------------------------微信下单参数-----------------------------------------------

    private String body; //微信支付时的内容说明

    private String outTradeNo;  //外部订单号

    private String total_fee; //订单金额

    private String spbill_create_ip; //机器的ip

    private String nonce_str;//随机字符串

    private String time_end; //交易完成时间

//-------------------------------微信下单响应----------------------------------

    private String sign; //返回的签名


    private String tradeNo;  //微信官方订单号
    //-------------------------------------------------------------------------------------------


    public String getTime_end() {
        return time_end;
    }

    public void setTime_end(String time_end) {
        this.time_end = time_end;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public int getOrderStatus() {
        return OrderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        OrderStatus = orderStatus;
    }

    public String getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    public int getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(int refundStatus) {
        this.refundStatus = refundStatus;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(String total_fee) {
        this.total_fee = total_fee;
    }

    public String getSpbill_create_ip() {
        return spbill_create_ip;
    }

    public void setSpbill_create_ip(String spbill_create_ip) {
        this.spbill_create_ip = spbill_create_ip;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public String toString() {
        return "WxPayOrder{" +
                "id=" + id +
                ", type=" + type +
                ", userId=" + userId +
                ", OrderStatus=" + OrderStatus +
                ", refundReason='" + refundReason + '\'' +
                ", refundStatus=" + refundStatus +
                ", storeId='" + storeId + '\'' +
                ", body='" + body + '\'' +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", total_fee='" + total_fee + '\'' +
                ", spbill_create_ip='" + spbill_create_ip + '\'' +
                ", nonce_str='" + nonce_str + '\'' +
                ", time_end='" + time_end + '\'' +
                ", sign='" + sign + '\'' +
                ", tradeNo='" + tradeNo + '\'' +
                '}';
    }
}
